Skip to content

Add unit tests for authentication API #2

Closed

Description

@wisdomqin

Description

The auth module (backend/app/api/auth.py) currently has no automated tests. Adding basic test coverage would improve code reliability.

What to do

  1. Create backend/tests/test_auth.py
  2. Add tests for key endpoints:
    • POST /api/auth/register — successful registration
    • POST /api/auth/login — successful login, wrong password
    • GET /api/auth/me — authenticated vs unauthenticated
  3. Use pytest + httpx (already in dev dependencies)

Resources

  • Auth router: backend/app/api/auth.py
  • Test config: backend/pyproject.toml (asyncio_mode = auto)
  • Run tests: cd backend && .venv/bin/pytest

Activity

  1. added a commit that references this issue on Apr 7, 2026
    572e127
  2. added a commit that references this issue on Apr 15, 2026
    51e42f8
  3. added 3 commits that reference this issue on Aug 16, 2026
    0abf198
    1e92937
    cccc193
  4. added a commit that references this issue on Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions